package Basic.day06.homework;

import java.util.Arrays;
import java.util.Scanner;

public class HomeWork01 {
    public static void main(String[] args) {
        int[] nums = new int[10];
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入10个整数：");
        for (int i = 0; i < nums.length; i++) {
            nums[i] = sc.nextInt();
        }
        System.out.println(Arrays.toString(nums));
        int maxOfArray = getMaxOfArray(nums);
        System.out.println("数组中的最大值是：" + maxOfArray);
    }

    /**
     * 获取数组中的最大值
     * @param nums
     * @return
     */
    private static int getMaxOfArray(int[] nums) {
        Arrays.sort(nums);
        int length = nums.length;
        return nums[length - 1];
    }
}
